package gaml.testing;

import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import gaml.core.Gaml;
import gaml.error.GamlException;
import gaml.java.ClassSerializerStore;
import gaml.java.serializer.ComplexSerializerFactory;
import gaml.java.serializer.collection.VectorSerializer;

import java.util.Vector;

import org.junit.Test;


public class VectorSerializerTest {
	
	class Foo extends Vector <String> {
		private static final long	serialVersionUID	= 1L;
		String fooname;
		
		public Foo (String fooname) { this.fooname = fooname; }
		public String getFooName () { return fooname; }
	}

	@Test
	public void testGetObjectClass () throws GamlException {
		ClassSerializerStore store = new ClassSerializerStore ();
		store.setComplexFactory (new ComplexSerializerFactory (store));

		store.register (new VectorSerializer (store));

		assertTrue (store.contains (Vector.class));

		Foo foo = new Foo ("Foo Name");
		foo.add ("AAAA");
		foo.add ("BBBB");

		System.out.println (new Gaml ().serialize (foo, Foo.class));
	}

	@Test
	public void testSerialize () {
		fail ("Not yet implemented");
	}
}